/**
 * 
 */
package com.puneet.graphqueries.yamlconfig;

import java.io.File;
import java.io.IOException;

import org.ho.yaml.Yaml;

/**
 * @author puneet
 * 
 */
public class YamlUtil {
	public static Configuration loadFile(String s) throws IOException {
		return Yaml.loadType(new File(s), Configuration.class);
	}
	
	public static String convertConfigToString(Configuration config) {
		return Yaml.dump(config, true);
	}
	
	public static Configuration loadString(String s) {
		return Yaml.loadType(s, Configuration.class);
	}
	
	public static void dumpYamlToFile(Configuration config,String file)throws IOException {
		Yaml.dump(config, new File(file));
	}

}
